package com.e3.web.core.server;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.e3.web.login.server.LoginHelper;

public class WebController extends HttpServlet{

	private static final long serialVersionUID = 6835542092217253431L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		processRequest(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		processRequest(req, resp);
	}

	private void processRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		if(!LoginHelper.isLogined(req)){
			LoginHelper.gotoLogin(req, resp);
			return;
		}
	}
	
}
